package com.chhlz.module.base.action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.chhlz.module.base.model.DishUnit;
import com.chhlz.module.service.DishUnitService;
import com.opensymphony.xwork2.ModelDriven;

@Controller
@Action(value = "dishUnit", results = { @Result(name = "dishUnit", location = "/dishUnit.html") })
public class DishUnitAction extends BasicDataAction<DishUnit> implements ModelDriven<DishUnit>{

	/**
	 * 
	 */
	private static final long serialVersionUID = 2087118040937308041L;
	
	@Autowired
	private DishUnitService unitService;
	private DishUnit dishUnit = new DishUnit();
	@Override
	public DishUnit getModel() {
		return this.dishUnit;
	}
	
	public void grid(){
		super.grid(unitService);
	}
	
	public void add(){
		super.add(unitService, dishUnit);
	}
	
	public void edit(){
		super.edit(unitService, dishUnit);
	}
	
	public void remove(){
		super.remove(unitService, dishUnit.getDuId());
	}

}
